package com.a214.yxz.yuejian013.Activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.TextView;

import com.a214.yxz.yuejian013.R;
import com.a214.yxz.yuejian013.Activity.UserSettingChangeInfoActivity;
import com.a214.yxz.yuejian013.Activity.UserSettingChangePwdActivity;
import com.a214.yxz.yuejian013.Activity.UserSettingCleanCachActivity;
import com.a214.yxz.yuejian013.Activity.UserSettingEmailUsActivity;
import com.a214.yxz.yuejian013.Activity.UserSettingInvFriendActivity;
import com.a214.yxz.yuejian013.Activity.UserSettingPostActivity;

public class UserSettingActivity extends AppCompatActivity implements View.OnClickListener {

    private ImageButton return_btn;
    private TextView changeInfo,changePwd,post,cleanCach,invFriend,emailUs;
    private Button logout;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_user_setting);

        return_btn= (ImageButton) findViewById(R.id.user_setting_return_btn);
        changeInfo= (TextView) findViewById(R.id.user_setting_changeInfo);
        changePwd= (TextView) findViewById(R.id.user_setting_changePwd);
        post= (TextView) findViewById(R.id.user_setting_post);
        cleanCach= (TextView) findViewById(R.id.user_setting_cleanCach);
        invFriend= (TextView) findViewById(R.id.user_setting_invFriend);
        emailUs= (TextView) findViewById(R.id.user_setting_emailUs);
        logout= (Button) findViewById(R.id.user_setting_logout);

        return_btn.setOnClickListener(this);
        changeInfo.setOnClickListener(this);
        changePwd.setOnClickListener(this);
        post.setOnClickListener(this);
        cleanCach.setOnClickListener(this);
        invFriend.setOnClickListener(this);
        emailUs.setOnClickListener(this);
        logout.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()){
            case R.id.user_setting_return_btn:
                finish();
                break;
            case R.id.user_setting_changeInfo:
                this.startActivity(new Intent(this, UserSettingChangeInfoActivity.class));
                break;
            case R.id.user_setting_changePwd:
                this.startActivity(new Intent(this, UserSettingChangePwdActivity.class));
                break;
            case R.id.user_setting_post:
                this.startActivity(new Intent(this, UserSettingPostActivity.class));
                break;
            case R.id.user_setting_cleanCach:
                this.startActivity(new Intent(this, UserSettingCleanCachActivity.class));
                break;
            case R.id.user_setting_invFriend:
                this.startActivity(new Intent(this, UserSettingInvFriendActivity.class));
                break;
            case R.id.user_setting_emailUs:
                this.startActivity(new Intent(this, UserSettingEmailUsActivity.class));
                break;
            case R.id.user_setting_logout:
                System.exit(0);
                break;
        }

    }
}
